package com.lian.community.async;

import com.lian.community.constant.EventType;

import java.util.HashMap;
import java.util.Map;

public class EventModel  {
    private EventType eventType;
    private int actorId;
    private int entityType;
    private int entityId;
    private int entityOnwerId;

    private Map<String,Object> exts = new HashMap<>();


    public EventModel() {
    }

    public EventModel(EventType eventType){
        this.eventType = eventType;
    }

    public EventType getEventType() {
        return eventType;
    }

    public EventModel setEventType(EventType eventType) {
        this.eventType = eventType;
        return this;
    }

    public int getActorId() {
        return actorId;
    }

    public EventModel setActorId(int actorId) {
        this.actorId = actorId;
        return this;
    }

    public int getEntityType() {
        return entityType;
    }

    public EventModel setEntityType(int entityType) {
        this.entityType = entityType;
        return this;
    }

    public int getEntityId() {
        return entityId;
    }

    public EventModel setEntityId(int entityId) {
        this.entityId = entityId;
        return this;
    }

    public int getEntityOnwerId() {
        return entityOnwerId;
    }

    public EventModel setEntityOnwerId(int entityOnwerId) {
        this.entityOnwerId = entityOnwerId;
        return this;
    }

    public Map<String, Object> getExts() {
        return exts;
    }

    /**
     * 为了方便外面传入，故把接口改成不用传入一个map，而是直接传入key和value
     * @param key
     * @param value
     * @return
     */
    public EventModel setExts(String key, String value) {
        exts.put(key, value);
        return this;
    }
}
